package com.sec.android.app.myfiles.module.trash;

import android.content.Context;
import android.net.Uri;

import com.sec.android.app.myfiles.R;
import com.sec.android.app.myfiles.module.abstraction.FileRecord;

/**
 * Created by gw8951.kim on 2016-11-12.
 */

public class TrashFileRecord extends FileRecord {
    String mFileId = null;
    int mDeviceId = 0;
    FileRecord mParentRecord = null;
    String mTrashProcessing = null;

    public TrashFileRecord(String fullPath) {
        mStorageType = StorageType.Trash;

        mName = FileRecord.getName(fullPath);
        mPath = FileRecord.getPath(fullPath);
    }

    // For adapter
    public TrashFileRecord(int id, int deviceId, String fileId, String path, String name, long size, long date,
                           int fileType, int isHidden, int itemCount, int itemCountHidden, String trashProcessing) {
        this(id, deviceId, fileId, path, name, size, date, fileType, isHidden, itemCount, itemCountHidden);

        mTrashProcessing = trashProcessing;
    }

    public TrashFileRecord(int id, int deviceId, String fileId, String path, String name, long size, long date,
                           int fileType, int isHidden, int itemCount, int itemCountHidden) {
        super(StorageType.Trash, id, path, name, size, date, fileType, isHidden, itemCount, itemCountHidden);

        mFileId = fileId;
        mDeviceId = deviceId;
    }

    //For GoTrashCmd
    public TrashFileRecord(StorageType type, String fullPath, FileRecord parentRecord) {
        mStorageType = type;
        mName = FileRecord.getName(fullPath);
        mPath = FileRecord.getPath(fullPath);
        mParentRecord = parentRecord;
    }

    @Override
    public FileRecord getParent() {
        return mParentRecord;
    }

    @Override
    public String getDisplayName(Context context) {
        return context.getString(R.string.trash);
    }

    @Override
    public boolean isRoot() {
        return false;
    }

    @Override
    protected int _getId() {
        return mId;
    }

    public String getFileId() {
        return mFileId;
    }


    public int getDeviceId() {
        return mDeviceId;
    }

    public void setDeviceId(int deviceId) {
        mDeviceId = deviceId;
    }

    @Override
    protected Uri _getUri(Context context) {
        return null;
    }

    @Override
    public String getMimeType(Context context) {
        return null;
    }

    @Override
    public boolean exists(Context context) {
        return false;
    }

    public String getTrashProcessing() {
        return mTrashProcessing;
    }
}
